<?php

class MemberExpWorktype extends AppModel {
	var $name = "MemberExpWorktype";
	var $useTable = "member_exp_worktype_info";
	var $primaryKey = 'id';
	
	var $belongsTo = array(
		
		'SysParams40'=>array(
			'className'=>'SysParams', 'order'=>'', 
			'foreignKey'=>'"exp_category"="SysParams40"."id" AND "SysParams40"."kbn"=\'gyoshu_id\' and "SysParams40"."id"' 
		), 
		'SysParams50'=>array(
			'className'=>'SysParams', 'order'=>'', 
			'foreignKey'=>'"exp_worktype_big"="SysParams50"."id" AND "SysParams50"."kbn"=\'shokusyu_id\' and "SysParams50"."id"' 
		), 
		'SysParams60'=>array(
			'className'=>'SysParams', 'order'=>'', 
			'foreignKey'=>'"exp_worktype_small"="SysParams60"."id" AND "SysParams60"."kbn"=\'shokusyu_id\' and "SysParams60"."id"' 
		) 
	);
	
	function doDelete($id) {
		
		$sql = "update member_exp_worktype_info MemberExpWorktype set deleted=now() " . " where MemberExpWorktype.id in ($id)";
		$this->query($sql);
	}
	
	/*
	 * @author wang.wei add
	* 2012/03/14
	* */
	function doDeleteFormMemberId($member_id) {
	
		$sql = "update member_exp_worktype_info MemberExpWorktype set deleted=now() " . " where MemberExpWorktype.member_id = '$member_id' and deleted is null";
		$this->query($sql);
	}

}
?>